import 'package:flutter/material.dart';

class MyApp11 extends StatelessWidget {
  const MyApp11({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('层叠布局'),
          backgroundColor: Colors.red,
          centerTitle: true,
        ),
        body: Center(
          child: Stack(
            //clipBehavior: Clip.none:设置图标不裁剪
            clipBehavior: Clip.none,
            alignment: Alignment.center,
            children: [
              Container(
                width: 200,
                height: 200,
                color: const Color.fromARGB(255, 155, 205, 247),
              ),
              //设置图标自定义的位置
              Positioned(top: -100, child: Image.asset('open_eyes.png')),
              const Icon(
                Icons.ad_units_outlined,
                size: 100,
              )
            ],
          ),
        ));
  }
}
